package com.daocao.jy.api.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.daocao.jy.api.ResponseModel;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by xsooy-pc on 18-5-2.
 */

public class LeveListModel extends ResponseModel implements Parcelable {

    public ArrayList<DatasBean> datas;

    public static class DatasBean implements Parcelable {
        /**
         * id : 1
         * name : 银卡会员
         * sale : 99
         * money : 0.00
         * term_sale : 80
         * uolevel_rate : 1.0
         * utlevel_rate : 0.5
         * up_money : 0.00
         * level : 1
         */

        public int id;
        public String name;
        public String sale;
        public String money;
        public String term_sale;
        public String uolevel_rate;
        public String utlevel_rate;
        public String up_money;
        public String level;

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(this.id);
            dest.writeString(this.name);
            dest.writeString(this.sale);
            dest.writeString(this.money);
            dest.writeString(this.term_sale);
            dest.writeString(this.uolevel_rate);
            dest.writeString(this.utlevel_rate);
            dest.writeString(this.up_money);
            dest.writeString(this.level);
        }

        public DatasBean() {
        }

        protected DatasBean(Parcel in) {
            this.id = in.readInt();
            this.name = in.readString();
            this.sale = in.readString();
            this.money = in.readString();
            this.term_sale = in.readString();
            this.uolevel_rate = in.readString();
            this.utlevel_rate = in.readString();
            this.up_money = in.readString();
            this.level = in.readString();
        }

        public static final Creator<DatasBean> CREATOR = new Creator<DatasBean>() {
            @Override
            public DatasBean createFromParcel(Parcel source) {
                return new DatasBean(source);
            }

            @Override
            public DatasBean[] newArray(int size) {
                return new DatasBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeList(this.datas);
    }

    public LeveListModel() {
    }

    protected LeveListModel(Parcel in) {
        this.datas = new ArrayList<DatasBean>();
        in.readList(this.datas, DatasBean.class.getClassLoader());
    }

    public static final Parcelable.Creator<LeveListModel> CREATOR = new Parcelable.Creator<LeveListModel>() {
        @Override
        public LeveListModel createFromParcel(Parcel source) {
            return new LeveListModel(source);
        }

        @Override
        public LeveListModel[] newArray(int size) {
            return new LeveListModel[size];
        }
    };
}
